import request from '@/utils/request'

//视频配置相关接口
export function getVideoConfigList() {
    return request({
        url: `/adm/v1/video/config/list`,
        method: 'get',
    })
}
export function editVideoConfig(data) {
    return request({
        url: "/adm/v1/video/config",
        method: 'put',
        data
    })
}

//获取配置列表
export function getPageList(params) {
    return request({
        url: `/adm/v1/page/list`,
        method: 'get',
        params:{...params,tenant:"pico"},
    })
}

//获取单个配置
export function getPageOne(id) {
    return request({
        url: `/adm/v1/page/${id}`,
        method: 'get',
    })
}
//获取单个区块
export function getBlockOne(id) {
    return request({
        url: `/adm/v1/page/item/${id}`,
        method: 'get',
    })
}
//添加页面配置
export function createPage(data) {
    return request({
        url: '/adm/v1/page',
        method: 'post',
        data
    })
}
//修改页面配置
export function editPage(data) {
    return request({
        url: `/adm/v1/page`,
        method: 'put',
        data
    })
}
//删除页面
export function deletePage(id) {
    return request({
        url: `/adm/v1/page/${id}`,
        method: 'delete',
    })
}


//获取区块列表
export function getBlockList(id, params) {
    return request({
        url: `/adm/v1/page/${id}/item/list`,
        method: 'get',
        params,
    })
}


//获取class列表
export function getClassList() {
    return request({
        url: `/adm/v1/page/class/list`,
        method: 'get',
    })
}
//添加区块配置
export function createBlock(data) {
    return request({
        url: '/adm/v1/page/item',
        method: 'post',
        data
    })
}
//删除区块
export function deleteBlock(id) {
    return request({
        url: `/adm/v1/page/item/${id}`,
        method: 'delete',
    })
}

//添加内容配置
export function createItems(data) {
    return request({
        url: '/adm/v1/page/item',
        method: 'put',
        data
    })
}

// h活动部分id /adm/v1/config/list
export function getConfigList() {
    return request({
        url: '/adm/v1/config/list',
        method: 'get',
        params:{
            tenant: "pico"
        }
    })
}
// 增加修改
export function editConfigList(data) {
    const url = data.id ? '/adm/v1/config/update': '/adm/v1/config/add'
    const method = data.id ? 'put' :'post'
    return request({
        url,
        method,
        data
    })
}

// 版本发布列表
export function getVersionList(params){
    return request({
        url: '/adm/v1/version/',
        method: 'get',
        params,
    })
}
// 版本版本列表（包含是否被使用状态）
export function getVersionStatusList(){
    return request({
        url: '/adm/v1/version/list',
        method: 'get',
    })
}
// 新增版本发布
export function addVersion(data){
    return request({
        url: '/adm/v1/version/',
        method: 'post',
        data
    })
}



// 数据配置-banner配置
// 获取后台列表 GET /adm/v1/bannerSet/list
export function getBannerList(params){
    return request({
        url: '/adm/v1/bannerSet/list',
        method: 'get',
        params,
    })
}
// 批量修改排序 PUT /adm/v1/bannerSet/modify/sort
export function modifyBannerSort(data) {
    return request({
        url: '/adm/v1/bannerSet/modify/sort',
        method: 'put',
        data
    })
}
// 排序查询列表 GET /adm/v1/bannerSet/available/list
export function getBannerSortList(params){
    return request({
        url: '/adm/v1/bannerSet/available/list',
        method: 'get',
        params,
    })
}
// 获取详情 GET /adm/v1/bannerSet/details/1
export function getBannerDetail(id){
    return request({
        url: `/adm/v1/bannerSet/details/${id}`,
        method: 'get',
    })
}
// 修改 PUT /adm/v1/bannerSet/edit
export function modifyBanner(data) {
    return request({
        url: '/adm/v1/bannerSet/edit',
        method: 'put',
        data
    })
}
// 添加一个banner图 POST /adm/v1/bannerSet/add
export function addBanner(data){
    return request({
        url: '/adm/v1/bannerSet/add',
        method: 'post',
        data
    })
}

// 数据配置-提现金额配置
// 提现金额配置 GET /adm/v1/draw/amount/config
// 列表	GET /adm/v1/amount/list
export function getWithdrawConfigList(params){
    return request({
        url: `/adm/v1/draw/amount/config`,
        method: 'get',
        params,
    })
}
// 批量修改金额配置排序	PUT /adm/v1/draw/amount/config/sort
// 批量修改排序	PUT cm/adm/v1/amount/modify/sort
export function modifyWithdrawConfigSort(data) {
    return request({
        url: '/adm/v1/draw/amount/config/sort',
        method: 'put',
        data
    })
}
// 修改小饼干提现金额 PUT /adm/v1/draw/amount/config
// 修改状态	POST cm/adm/v1/amount/edit/status/{id}
export function modifyWithdrawConfig(data){
    return request({
        url: '/adm/v1/draw/amount/config',
        method: 'put',
        data
    })
}
// 新增小饼干提现金额 POST /adm/v1/draw/amount/config
// 添加一条提现金额配置	POST cm/adm/v1/amount/add
export function addWithdrawConfig(data){
    return request({
        url: '/adm/v1/draw/amount/config',
        method: 'post',
        data
    })
}


// 数据配置-打赏礼物配置
// 获取列表 GET /adm/v1/goods/list
export function getRewardConfiglist(params){
    return request({
        url: '/adm/v1/goods/list',
        method: 'get',
        params
    })
}
// 批量修改排序 PUT /adm/v1/goods/modify/sort
export function modifyRewardConfigSort(data){
    return request({
        url: '/adm/v1/goods/modify/sort',
        method: 'put',
        data
    })
}
// 修改一条礼物设置 PUT /adm/v1/goods/edit
export function modifyRewardConfig(data){
    return request({
        url: '/adm/v1/goods/edit',
        method: 'put',
        data
    })
}
// 添加一条礼物设置 POST /adm/v1/goods/add
export function addRewardConfig(data){
    return request({
        url: '/adm/v1/goods/add',
        method: 'post',
        data
    })
}
